package com.google.code.timetrail.presenter;



import com.google.code.timetrail.backend.Control;

public class SkillFrameBackend {

    private Control myGameControl;


    public SkillFrameBackend(Control gameControl){
        myGameControl = gameControl;
    }


    public String getSwimLabel() {
        return "Swimming";
    }


    public String getFitnessLabel() {
        return "Fitness";
    }


    public String getBargainLabel() {
        return "Bargaining";
    }


    public String getImmunityLabel() {
        return "Immunity";
    }


    public int getMinSkillLevel() {
        return 0;
    }


    public int getMaxSkillLevel() {
        return 100;
    }


    public int getSwimSkill() {
        return myGameControl.getPlayer().getSkills()[0];
    }


    public int getFitnessSkill() {
        return myGameControl.getPlayer().getSkills()[1];
    }


    public int getBargainSkill() {
        return myGameControl.getPlayer().getSkills()[2];
    }


    public int getImmunitySkill() {
        return myGameControl.getPlayer().getSkills()[3];
    }


    public String getBackButtonText() {
        return "Back <<";
    }


    public void upgradeSwimming() {
        int[] skills = myGameControl.getPlayer().getSkills();
        skills[0] += 5;
        if(skills[0] > 100){
            skills[0] = 100;
        }
        myGameControl.getPlayer().setSkills(skills);
        
    }


    public void upgradeFitness() {
        int[] skills = myGameControl.getPlayer().getSkills();
        
        skills[1] += 5;
        if(skills[1] > 100){
            skills[1] = 100;
        }
        myGameControl.getPlayer().setSkills(skills);
        
    }


    public void upgradeBargaining() {
        int[] skills = myGameControl.getPlayer().getSkills();
        
        skills[2] += 5;
        if(skills[2] > 100){
            skills[2] = 100;
        }
        myGameControl.getPlayer().setSkills(skills);
        
        
    }


    public void upgradeImmunity() {
        int[] skills = myGameControl.getPlayer().getSkills();
        
        skills[3] += 5;
        if(skills[3] > 100){
            skills[3] = 100;
        }
        myGameControl.getPlayer().setSkills(skills);
    }
}
